package com.markyao.controller.recos;

import com.markyao.recos.kill.RecosKillService;
import com.markyao.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/recos/kill/")
public class RecosKillController {

    @Autowired
    RecosKillService recosKillService;

    @GetMapping("killConnect")
    public Result killConnect(@RequestParam("appName") String appName,@RequestParam("url") String url) {
        return recosKillService.killConnect(appName,url);
    }

    @GetMapping("hasKills")
    public Result hasKills(@RequestParam("appName")String thisAppName) {
        Result result = recosKillService.hasKills(thisAppName);
        return result;
    }

    @GetMapping("killOk")
    public Result killOk(@RequestParam("appName")String appName) {
        return recosKillService.killOk(appName);
    }

    @GetMapping("reconnectOk")
    public Result reconnectOk(@RequestParam("appName")String appName) {
        return recosKillService.reconnectOk(appName);
    }


    @GetMapping("hasReconnects")
    public Result hasReconnects(@RequestParam("appName")String appName) {
        return recosKillService.hasReconnects(appName);
    }


}
